package com.xq.model.utils;

import com.xq.config.properties.MusicProperties;
import com.xq.model.dto.ParentDTO;
import org.springframework.stereotype.Component;


import java.util.UUID;

/**
 * 公共父类工具类
 *
 * @author xu
 * 2021/8/9 18:47
 */
@Component
public class ParentUtils {

    /**
     * 初始化
     */
    public void init(ParentDTO parentDTO,MusicProperties musicProperties){
        parentDTO.setNonce(UUID.randomUUID().toString());
        parentDTO.setServiceNodeId("NMIC_MUSIC_CMADAAS");
        parentDTO.setPwd(musicProperties.getPwd());
        parentDTO.setUserId(musicProperties.getUserId());
        parentDTO.setTimestamp(String.valueOf(System.currentTimeMillis()));
    }
}
